﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using System.Security;
using System.ServiceProcess;


namespace Pruebas
{
    class Program
    {

        static void Main()
        {
            string idioma = Thread.CurrentThread.CurrentUICulture.NativeName;
            Console.WriteLine();
            Console.WriteLine("Idioma :        {0}", idioma);
            Console.ReadLine();
         /*   ServiceController[] scServices;
            scServices = ServiceController.GetServices();

            foreach (ServiceController scTemp in scServices)
            {
                if (scTemp.ServiceName == "wampmysqld")
                {
                    if (scTemp.Status == ServiceControllerStatus.Stopped)
                    {
                        scTemp.Start();
                    }
                    Console.WriteLine();
                    Console.WriteLine("  Service :        {0}", scTemp.ServiceName);
                    Console.WriteLine("    Display name:    {0}", scTemp.DisplayName);
                    Console.ReadLine();
                }
            }*/
        /*    
            Process process = new Process();
            process.StartInfo.FileName = "C:\\Windows\\Temp\\install_mysql.bat";
            process.StartInfo.CreateNoWindow = false;
            process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
            process.Start();
            process.EnableRaisingEvents = true;
            process.WaitForExit();*/
     /*       Process process = new Process();
            process.StartInfo.FileName = "c:\\Windows\\Temp\\wamp.bat";
            process.StartInfo.CreateNoWindow = false;
            process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process.Start();
            process.EnableRaisingEvents = true;
            process.WaitForExit();
            foreach (Process proceso in Process.GetProcesses())
            {
                if (proceso.ProcessName.Equals("wampmanager"))
                {
                    proceso.Kill();
                    break;
                }
            }*/

          //  #endregion

         /*   #region configMySQL            
            System.IO.StreamWriter swConfig = System.IO.File.CreateText("c:\\Windows\\Temp\\config.bat"); // creo el archivo .bat
            swConfig.Close();
            StringBuilder sbConfig = new StringBuilder();
            sbConfig.AppendLine("C:\\wamp\\bin\\mysql\\mysql5.1.36\\bin\\mysql.exe -u root -e \"GRANT ALL ON *.* TO 'ncsoftwa_re'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;\" ");
            sbConfig.AppendLine(@"C:\wamp\bin\mysql\mysql5.1.36\bin\mysql.exe -u root < c:\pos.sql");            
            using (StreamWriter outfile = new StreamWriter("c:\\Windows\\Temp\\config.bat", true)) // escribo el archivo .bat
            {
                outfile.Write(sbConfig.ToString());
            }
            Process process2 = new Process();
            process2.StartInfo.FileName = "c:\\Windows\\Temp\\config.bat";
            process2.StartInfo.CreateNoWindow = false;
            process2.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process2.Start();
            process2.EnableRaisingEvents = true;
            process2.WaitForExit();
            #endregion*/
        }

    }
}
